﻿using System;
using System.Runtime.Serialization;

namespace OCXS.OCXSServiceLibrary.OPCXMLDA10 {

    [DataContract(Namespace = "http://opcfoundation.org/webservices/XMLDA/1.0/")]
    public class ItemValue : System.ComponentModel.INotifyPropertyChanged {

        private string diagnosticInfoField;

        private object valueField;

        private OPCQuality qualityField;

        private System.Xml.XmlQualifiedName valueTypeQualifierField;

        private string itemPathField;

        private string itemNameField;

        private string clientItemHandleField;

        private System.DateTime timestampField;

        private bool timestampFieldSpecified;

        private System.Xml.XmlQualifiedName resultIDField;

        [DataMember(Order = 0)]
        public string DiagnosticInfo {
            get {
                return this.diagnosticInfoField;
            }
            set {
                this.diagnosticInfoField = value;
                this.RaisePropertyChanged("DiagnosticInfo");
            }
        }

        [DataMember(Order = 1)]
        public object Value {
            get {
                return this.valueField;
            }
            set {
                this.valueField = value;
                this.RaisePropertyChanged("Value");
            }
        }

        [DataMember(Order = 2)]
        public OPCQuality Quality {
            get {
                return this.qualityField;
            }
            set {
                this.qualityField = value;
                this.RaisePropertyChanged("Quality");
            }
        }

        [DataMember(Order = 3)]
        public System.Xml.XmlQualifiedName ValueTypeQualifier {
            get {
                return this.valueTypeQualifierField;
            }
            set {
                this.valueTypeQualifierField = value;
                this.RaisePropertyChanged("ValueTypeQualifier");
            }
        }

        [DataMember(Order = 4)]
        public string ItemPath {
            get {
                return this.itemPathField;
            }
            set {
                this.itemPathField = value;
                this.RaisePropertyChanged("ItemPath");
            }
        }

        [DataMember(Order = 5)]
        public string ItemName {
            get {
                return this.itemNameField;
            }
            set {
                this.itemNameField = value;
                this.RaisePropertyChanged("ItemName");
            }
        }

        [DataMember(Order = 6)]
        public string ClientItemHandle {
            get {
                return this.clientItemHandleField;
            }
            set {
                this.clientItemHandleField = value;
                this.RaisePropertyChanged("ClientItemHandle");
            }
        }

        [DataMember(Order = 7)]
        public System.DateTime Timestamp {
            get {
                return this.timestampField;
            }
            set {
                this.timestampField = value;
                this.RaisePropertyChanged("Timestamp");
            }
        }

        [DataMember(Order = 8)]
        public bool TimestampSpecified {
            get {
                return this.timestampFieldSpecified;
            }
            set {
                this.timestampFieldSpecified = value;
                this.RaisePropertyChanged("TimestampSpecified");
            }
        }

        [DataMember(Order = 9)]
        public System.Xml.XmlQualifiedName ResultID {
            get {
                return this.resultIDField;
            }
            set {
                this.resultIDField = value;
                this.RaisePropertyChanged("ResultID");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
